home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
mac
/
data
/
xxi_appendice_dvd.swf
/
scripts
/
__Packages
/
CHistory.as
< prev
next >
Wrap
Text File
|
2007-11-08
|
2KB
|
76 lines
class CHistory extends Object
{
function CHistory()
{
super();
this.mMaxLenght = 50;
this.mHistory = new Array();
this.mPosition = 0;
}
function Back()
{
var _loc2_ = undefined;
if(this.mPosition > 0)
{
this.mPosition = this.mPosition - 1;
_loc2_ = this.mHistory[this.mPosition];
}
return _loc2_;
}
function Forward()
{
var _loc2_ = undefined;
if(this.mPosition < this.GetLength() - 1)
{
this.mPosition = this.mPosition + 1;
_loc2_ = this.mHistory[this.mPosition];
}
return _loc2_;
}
function Goto(inPosition)
{
var _loc2_ = undefined;
if(inPosition >= 0 && inPosition < this.GetLength())
{
this.mPosition = inPosition;
_loc2_ = this.mHistory[this.mPosition];
}
return _loc2_;
}
function Add(inObject, inFrom)
{
if(this.mHistory.length > 0)
{
var _loc4_ = this.mHistory[this.mHistory.length - 1];
if(inObject.mId == _loc4_.id && inObject.mTipo == _loc4_.tipo)
{
return false;
}
}
var _loc2_ = new Object();
_loc2_.id = inObject.mId;
if(inObject.mTipo == undefined)
{
}
_loc2_.tipo = inObject.mTipo;
_loc2_.titolo = inObject.mTitolo;
_loc2_.label = inObject.mTitolo;
_loc2_.from = inFrom;
this.mHistory.push(_loc2_);
this.mPosition = this.mHistory.length - 1;
return true;
}
function GetLength()
{
return this.mHistory.length;
}
function GetPosition()
{
return this.mPosition;
}
function GetData()
{
return this.mHistory;
}
}